package controller

import (
	"awesomeProject/service"

	"github.com/kataras/iris/v12"
	"github.com/kataras/iris/v12/mvc"
)

type ProductController struct {
	ctx     iris.Context
	service service.IProductService
}

func (p ProductController) GetAll() mvc.View {
	products, _ := p.service.GetAllProduct()
	return mvc.View{
		Name: "product\\view.html",
		Data: iris.Map{
			"products": products,
		},
	}
}
